import pymysql

conn = pymysql.connect(host='localhost', user='root', password='0830', database='moonlightcat_test')
cursor = conn.cursor()
def getDatafromCity():
    sql = """select `id`,`href` from city"""
    cursor.execute(sql)
    result = cursor.fetchall()

    return  result

def getDatafromxian():
    sql = """select `id`,`cityHref` from area"""
    cursor.execute(sql)
    result1 = cursor.fetchall()
    return result1

def getDatafromjian():
    sql = """select id,name,href from jian"""
    cursor.execute(sql)
    result2 = cursor.fetchall()
    return result2
